package com.example.demo.domain;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.awt.*;

@Data
@NoArgsConstructor
public class ImgEntity {

    /**
     * 生成图片内容
     */
    private String text;
    /**
     * 生成图片宽度
     */
    private int width;
    /**
     * 生成图片高度
     */
    private int height;
    /**
     * 文字大小
     */
    private float fontsize;
    /**
     * 旋转角度 正数 按顺时针方向，负数 按逆时针方向
     */
    private float rotate;
    /**
     * 文字透明度，取值 0~1之间
     */
    private float opacity;
    /**
     * 文字颜色
     */
    private Color color;

    public ImgEntity(String text) {
        this.text = text;
        this.width = 200;
        this.height = 100;
        this.fontsize = 20f;
        this.rotate = -40f;
        this.opacity = 0.3f;
        this.color = Color.LIGHT_GRAY;
    }

    public ImgEntity(String text, int width, int height, float fontsize) {
        this.text = text;
        this.width = width;
        this.height = height;
        this.fontsize = fontsize;
        this.rotate = -40f;
        this.opacity = 0.3f;
        this.color = Color.LIGHT_GRAY;
    }

    public ImgEntity(String text, int width, int height, float fontsize, float rotate, float opacity, Color color) {
        this.text = text;
        this.width = width;
        this.height = height;
        this.fontsize = fontsize;
        this.rotate = rotate;
        this.opacity = opacity;
        this.color = color;
    }

}
